Skip to content

Comments

Fix: Wait for flowr session to start#365

Merged
gigalasr merged 2 commits intomainfrom
364-wait-for-flowr-session
Feb 2, 2026
Merged

Fix: Wait for flowr session to start#365
gigalasr merged 2 commits intomainfrom
364-wait-for-flowr-session

Conversation

@gigalasr
Copy link
Collaborator

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens diagram generation against race conditions where the internal Flowr session is not yet ready, and avoids opening empty diagram panels when generation fails.

Changes:

  • In FlowrInternalSession.startWorkWithProgressBar, added a retry loop that waits for the internal parser/session to become available (with bounded backoff) before creating an analyzer, and shows a clear error if the session never becomes ready.
  • Ensured working state is managed correctly when the session never initializes by explicitly resetting it before returning on failure.
  • In DiagramUpdateCoordinator.createDiagramPanel, prevented diagram webview creation when the underlying mermaid generation returns an empty string, treating that as a failed generation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/flowr/internal-session.ts Adds bounded retry and user-facing error handling when the internal Flowr analyzer session is not yet ready before performing diagram work.
src/flowr/diagrams/diagram.ts Skips creating a diagram webview when mermaid generation fails and returns an empty string, avoiding empty/invalid panels.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gigalasr gigalasr merged commit 4629e5d into main Feb 2, 2026
7 checks passed
@gigalasr gigalasr deleted the 364-wait-for-flowr-session branch February 2, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants